// create by dplord at 2017-02-22 16:31

#include <iostream>
using namespace std;




class A {
public:
    A() {
        p = new int[10000000];
    }
    void print() {
        printf("%p \n", p);
    }
    ~A() {
        printf("调用析构\n");
        delete p;
    }
private:
    int* p;
};
int main(int argc, char **argv) {

    //测试纯 delete
  /*  
    int* p;
    for (int i = 0; i < 1000000; ++i) {
        p = new int[100000];
        printf("%x \n", p);
        delete p;
        printf("%x \n", p);
        sleep(1);
    }
*/
    
    //测试类的析构
    for (int i = 0; i < 10000; ++i) {
        A* a = new A;
        a->print();
        delete a;
    }

    return 0;
}